home *** CD-ROM | disk | FTP | other *** search
/ Get a Grip Tennis by Wilson / Get a Grip Tennis by Wilson.iso / pc / wilson.dxr / Internal_61_SoundManager.ls < prev    next >
Encoding:
Text File  |  2003-08-12  |  951 b   |  63 lines

  1. property pVOplayed, pBGplaying, pSoundOn, pBGvol
  2.  
  3. on new me
  4.   pBGvol = 125
  5.   sound(1).volume = 255
  6.   sound(2).volume = pBGvol
  7.   sound(3).volume = 255
  8.   pVOplayed = 0
  9.   pBGplaying = 0
  10.   pSoundOn = 1
  11.   return me
  12. end
  13.  
  14. on checkSound me
  15.   if pVOplayed = 0 then
  16.     playVO()
  17.   else
  18.     if (pVOplayed = 1) and (sound(1).status = 0) and (pBGplaying = 0) then
  19.       playBG()
  20.     end if
  21.   end if
  22. end
  23.  
  24. on killVO me
  25.   puppetSound(1, 0)
  26. end
  27.  
  28. on playVO me
  29.   if sound(1).status = 0 then
  30.     puppetSound(1, "IntroAudio")
  31.   end if
  32.   killBG()
  33.   pVOplayed = 1
  34. end
  35.  
  36. on playBG me
  37.   if pBGplaying <> 1 then
  38.     puppetSound(2, "backgroundMusic")
  39.   end if
  40.   pBGplaying = 1
  41. end
  42.  
  43. on killBG me
  44.   puppetSound(2, 0)
  45.   pBGplaying = 0
  46. end
  47.  
  48. on fadeBG me, sec
  49.   sound fadeOut 2, sec * 60
  50. end
  51.  
  52. on toggleAudio
  53.   if pSoundOn then
  54.     sound(2).volume = 0
  55.     sound(3).volume = 0
  56.     pSoundOn = 0
  57.   else
  58.     sound(2).volume = pBGvol
  59.     sound(3).volume = 150
  60.     pSoundOn = 1
  61.   end if
  62. end
  63.